package online.longzipeng.cinemasys.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import online.longzipeng.cinemasys.dto.customer.CustomerLoginResponseDTO;
import online.longzipeng.cinemasys.dto.customer.CustomerQueryResponseDTO;
import online.longzipeng.cinemasys.entity.Customer;
import com.baomidou.mybatisplus.extension.service.IService;
import online.longzipeng.cinemasys.vo.customer.*;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lzp
 * @since 2021-04-09
 */
public interface CustomerService extends IService<Customer> {

    /**
     * 新增用户
     */
    void add(Customer customer);

    /**
     * 修改客户
     */
    void updateCustomer(Customer customer);

    /**
     * 修改密码
     */
    void changePassword(CustomerChangePasswordVO customerChangePasswordVO);

    /**
     * 查询所有用户带分页
     */
    IPage<CustomerQueryResponseDTO> getListPage(CustomerQueryVO queryVO);

    /**
     * 通过用户名查找用户
     */
    Customer findByUserName(String userName);

    /**
     * 通过id查询用户详细信息
     */
    CustomerQueryResponseDTO findById(Long id);

    /**
     * 客户登录
     */
    CustomerLoginResponseDTO login(CustomerLoginVO customerLoginVO, HttpServletRequest httpServletRequest);

    /**
     * 获取用户详情
     */
    CustomerQueryResponseDTO getUserInfo(String token);

    /**
     * 邮箱生成验证码
     */
    void getResetCode(String userName,String email);

    /**
     * 通过邮箱和验证码修改密码
     */
    void changePasswordByEmailCheck(CustomerChangePassWordByEmailVO customerChangePassWordByEmailVO);
}
